package edu.map.aamas.charts;

import javax.swing.JFrame;

import edu.map.aamas.rnn.RNN;

public class ForceChart extends RnnChart {

	private static final long serialVersionUID = 1L;
	
	public ForceChart(RNN rnr) {
		super(rnr, new String[] {"actuation"});
	}
	
	public void rnnUpdated(RNN rnr) {
		update(new double[]{rnr.getDiffC0C1()});
	}
	
	public static void main(String[] args) throws Exception{
		JFrame test = new JFrame("test");		
		RNN rnr = RNN.getInstance();
		ForceChart chart = new ForceChart(rnr);
		rnr.addRnrListener(chart);
		test.setSize(400, 100);
		test.add(chart);
		test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		test.setVisible(true);
		
		while (true) {
			rnr.update();
			Thread.sleep(30);
		}
	}

}
